package management;

import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;

import server.BillingServerSecure;
import server.IBillingServer;
import server.IBillingServerSecure;

public class ManagementClient {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		/*if (System.getSecurityManager() == null) {
            System.setSecurityManager(new SecurityManager());
        }*/
        try {
            String name = "IBillingServer";
            Registry registry = LocateRegistry.getRegistry();
            IBillingServer billServ = (IBillingServer) registry.lookup(name);
            System.out.println("login with john and dslab2012");
            IBillingServerSecure billServSec = billServ.login("john", "dslab2012");
            if (billServSec != null) {
            	System.out.println("success");
            } else {
            	System.out.println("failed");
            }
        } catch (Exception e) {
            System.err.println("IBillingServer.login exception:");
            e.printStackTrace();
        }

	}

}
